<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(dirname(__FILE__)),
	'name'=>'Persik Kediri FC',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.*',
		'zii.widgets.*',
		'application.modules.user.models.*',
        'application.modules.user.components.*',
		'application.modules.poll.models.*',
		'application.modules.poll.components.*',
		'application.modules.user.extensions.*',
	),

	'defaultController'=>'site/index',
	'modules'=>array(
				'gii' => array(
						'class' => 'system.gii.GiiModule',
						'password' => 'oke',
						// If removed, Gii defaults to localhost only. Edit carefully to taste.
						'ipFilters' => array('127.0.0.1', '::1'),
					),
                'user',
				'poll' => array(
					   // Force users to vote before seeing results
					   'forceVote' => TRUE,
					   // Restrict anonymous votes by IP address,
					   // otherwise it's tied only to user_id 
					   'ipRestrict' => TRUE,
					   // Allow guests to cancel their votes
					   // if ipRestrict is enabled
					   'allowGuestCancel' => FALSE,
					 ),
				'shop' => array('currencySymbol' => 'Rp',)
        ),
	// application components
	'components'=>array(
		 'user'=>array(
                        // enable cookie-based authentication
                        'allowAutoLogin'=>true,
                        'loginUrl' => array('/user/login'),
         ),
		  'widgetFactory' => array(
            'widgets' => array(
                'LiveStream' => array(
                    'app_id' => '251627968245052',
                ),
            ),
        ),
		'facebook'=>array(
			'class' => 'ext.yii-facebook-opengraph.SFacebook',
			'appId'=>'251627968245052', // needed for JS SDK, Social Plugins and PHP SDK
			'secret'=>'97d0b585cc7585153289db26a50a129f', // needed for the PHP SDK 
			//'locale'=>'en_US', // override locale setting (defaults to en_US)
			//'jsSdk'=>true, // don't include JS SDK
			//'async'=>true, // load JS SDK asynchronously
			//'jsCallback'=>false, // declare if you are going to be inserting any JS callbacks to the async JS SDK loader
			//'status'=>true, // JS SDK - check login status
			//'cookie'=>true, // JS SDK - enable cookies to allow the server to access the session
			//'oauth'=>true,  // JS SDK -enable OAuth 2.0
			//'xfbml'=>true,  // JS SDK - parse XFBML / html5 Social Plugins
			//'html5'=>true,  // use html5 Social Plugins instead of XFBML
			//'ogTags'=>array(  // set default OG tags
				//'title'=>'MY_WEBSITE_NAME',
				//'description'=>'MY_WEBSITE_DESCRIPTION',
				//'image'=>'URL_TO_WEBSITE_LOGO',
			//),
		 ),
		/*
		'db'=>array(
			'connectionString' => 'sqlite:protected/data/blog.db',
			'tablePrefix' => 'tbl_',

		),
		*/
		'cache'=>array(
			'class'=>'system.caching.CFileCache',
		),
		
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=persik',
			'emulatePrepare' => true,
			'schemaCachingDuration' => 3600,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix' => 'tbl_',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'urlManager'=>array(
			'showScriptName'=>false, // enable this when .htaccess takes effect on the host
			'urlFormat'=>'path',
			'rules'=>array(
				'post/<id:\d+>/<title:.*?>'=>'post/view',
				'posts/<tag:.*?>'=>'post/index',
                                'date/<time:\d+>'=>'post/PostedOnDate',
                                'month/<time:\d+>/<pnc:p|c|n>'=>'post/PostedInMonth',
				'rss.xml'=>'site/feed',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		'images'=>array(
			'class'=>'CImageManager',
			'collections'=>array(
				'full' => 'images/full',
			),
			'transforms'=>array(
				'thumbnail' => array(
					'crop' => array(160,160),
				),
			),
		),

		'widgetCollapse'=>array(
			'class'=>'WidgetCollapse',
			'enable'=>true,
		),
		'highslide'=>array(
			'class'=>'Highslide',
			'enable'=>true,
		),

		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require(dirname(__FILE__).'/params.php'),
);